package day05.practice;

/**
 * @author yangwenqi
 * @decs TODO
 * @date 2025/4/14
 */
public class Practice21 {
    public static void main(String[] args) {
        //遍历字符串的每个字符
        String s = "chenmin@igeekhome.com";
        for (int i = 0; i < s.length(); i++) {
            char c = s.charAt(i);
            System.out.print("字符 " + i + ": " + c+"\t");
        }
        System.out.println();
        System.out.println("----------------------------方法二----------------------------------------");
        String s1 = "chenmin@igeekhome.com";
        char[] c1=s1.toCharArray();
        for (int i = 0; i < s.length(); i++) {
            System.out.print("字符 " + i + ": " + c1[i]+"\t");
        }

    }
}
